package com.alxbrendmaquinarias.validator;

import java.math.BigDecimal;

public class ValidatorUtil {

    public static boolean validarCadena(String cadena) {
        boolean flag = false;
        if (cadena == null) {
            flag = true;
        } else if (cadena.trim().length() == 0) {
            flag = true;
        } else {
            flag = false;
        }
        return flag;
    }

    public static boolean validarBigDecimal(BigDecimal bigDecimal) {
        boolean flag = false;
        if (bigDecimal == null) {
            flag = true;
        } else if (bigDecimal.longValue() <= 0) {
            flag = true;
        } else {
            flag = false;
        }
        return flag;
    }
}
